<?php
/*
 * 测试原型模式
 */

namespace App\Controller;

use App\DesignPattern\Decorator\Writer;
use App\DesignPattern\Decorator\ColorWriterDecorator;
use App\DesignPattern\Decorator\SizeWriterDecorator;

class ControllerDecorator {

	public function actionIndex()
    {
        $writer = new Writer();
        $writer->addDecorator(new ColorWriterDecorator());
        $writer->write();

        $writer->addDecorator(new SizeWriterDecorator());
        $writer->write();
	}
}
